﻿using System;
using System.Collections.Generic;
using UnityEngine;
using VoxelBlock.VoxelBlock3D;
using VoxelBlock;using Vector3Int = VoxelBlock.Vector3Int;

public class OperationImplementRead : OperationImplement
{

    Action<int> SetUVKey = (a) => {};


    public OperationImplementRead( Action<int> SetUVKey)
    {
        this.SetUVKey = SetUVKey;
    }

    public override void Start(StartArg arg)
    {
        base.Start(arg);

    }

    public override void Run(RunArg arg)
    {
        if (nowDrawVoxel3DCore.allVoxels.ContainsKey(arg.nowSelectPosition))
        {
            SetUVKey(nowDrawVoxel3DCore.allVoxels[arg.nowSelectPosition].uvKey);
        }
    }

    public override void Over(OverArg arg)
    {
        if (nowDrawVoxel3DCore.allVoxels.ContainsKey(arg.nowSelectPosition))
        {
            SetUVKey(nowDrawVoxel3DCore.allVoxels[arg.nowSelectPosition].uvKey);
        }
    }

}


